package com.sthz.facepay.model.result;

import com.sthz.facepay.enums.ApiResultEnum;

/**
 * web层统一返回类型
 * @author luli
 * @version jdk 1.8
 * @date 2019/7/12 11:05
 */
public class ApiResult {
    private int errCode = 0;

    private String errMsg;

    private Object data;

    public ApiResult(){

    }

    public ApiResult(Object data) {
        this.data = data;
    }

    public ApiResult(ApiResultEnum apiResponseEnum){
        this.errCode = apiResponseEnum.getErrCode();
        this.errMsg = apiResponseEnum.getErrMsg();
    }

    public int getErrCode() {
        return errCode;
    }

    public void setErrCode(int errCode) {
        this.errCode = errCode;
    }

    public String getErrMsg() {
        return errMsg;
    }

    public void setErrMsg(String errMsg) {
        this.errMsg = errMsg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "ApiResult{" +
                "errCode=" + errCode +
                ", errMsg='" + errMsg + '\'' +
                ", data=" + data +
                '}';
    }
}
